<?php
namespace app\home\controller;
use think\Controller;
use think\Db;

class Index extends Controller
{
	//显示首页
    public function index()
    {
       $newshop = Db::name('dining')
           ->where('createtime','>',0)->order('createtime desc')->select();
        $this->assign('newsshops',$newshop);
        $newsfood =\think\Db::name('food')->whereTime('startdate','month')->order('startdate desc')->select();
        $this->assign('newsfoods',$newsfood);
        $offer = \think\Db::name('food')->where('isspecial',1)->select();
        $hotshop = \think\Db::name('dining')->where('level','>','1')->order('shop_id desc')->select();
        $this->assign('hotshop', $hotshop);
        $this->assign('specialoffer',$offer);
        return $this->fetch();
    }
    //显示查询结果
    public function searchlists()
    {
        return $this->fetch();
    }
    
}
